package com.hkzhao.reportingsystem.component;

import com.hkzhao.reportingsystem.service.DoctorService;
import com.hkzhao.reportingsystem.service.MangerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//审核失败实际流程
@Component
@RabbitListener(queues = "reportsystem.doctor.verifyFail")
public class VerifyFailedReceiver {
    private static Logger LOGGER = LoggerFactory.getLogger(VerifyFailedReceiver.class);
    @Autowired
    private MangerService mangerService;
    @RabbitHandler
    public void handle(String username)
    {
        LOGGER.info("发出该用户审核失败的失败邮件:{}",username);
        mangerService.verifyFailedSendEamil(username);
    }
}
